using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using SmartLink.Domain.ExpandEntity.Oragnization;
using SmartLink.DTOS.ReportForms;
using SmartLink.DTOS.SysBasic;
using SmartPark.EnumLibrary;

namespace SmartLink.Infrastructure.Mappers
{
    public class OragnizationProfile : Profile
    {
        protected override void Configure()
        {
            CreateMap<OrganizationManageExpand, OrganizationDTO>()
                .ForMember(d => d.OrganizationType,
                    opt =>
                        opt.MapFrom(
                            item =>
                                DictionaryConvertHelper.GetDescriptionByValue(DictionaryConst.OrganizationType,
                                    item.OrganizationType)))
                .ForMember(d => d.StoreInfo, opt => opt.MapFrom(item => $"门店{item.StoreInfo}"))
                .ForMember(d => d.OrganizationStatus, opt => opt.MapFrom(item => ((OrganizationStatusEnum)item.OrganizationStatus).ToString()));

            CreateMap<SingleOragnizationInfoExapnd, UpdateOrganizationDTO>()
                .ForMember(d => d.OrganizationTypeName, opt => opt.MapFrom(item => DictionaryConvertHelper.GetDescriptionByValue(DictionaryConst.OrganizationType,
                                    item.OrganizationType)));

        }
    }
}
